import 'package:flutter/material.dart';
import 'package:flutter_teacher/view/alumni/index.dart';
import 'package:flutter_teacher/view/features/index.dart';
import 'package:flutter_teacher/view/message/index.dart';
import 'package:flutter_teacher/view/personal/index_personal.dart';

class Bottom extends StatefulWidget {
  @override
  _BottomState createState() => _BottomState();
}

class _BottomState extends State<Bottom> {
  int index =0;

  List _pages =[
    IndexMessagePage(),
    IndexFeaturesPage(),
    IndexAlumniCirclePage(),
    IndexPersonal()
  ];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: this._pages[this.index],
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: this.index,
        onTap: (int i)=>setState(()=>this.index=i),
        iconSize: 33.0,
        fixedColor: Colors.deepPurpleAccent,
        type: BottomNavigationBarType.fixed,
        items: [
          BottomNavigationBarItem(
            icon: Icon(Icons.message),
            title: Text("消息")
          ),BottomNavigationBarItem(
            icon: Icon(Icons.settings_applications),
            title: Text("功能")
          ),BottomNavigationBarItem(
            icon: Icon(Icons.album),
            title: Text("校友圈")
          ),
          BottomNavigationBarItem(
              icon: Icon(Icons.person),
              title: Text("個人中心1")),
        ],
      ),
    );
  }
}
